﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>卡片工具</title>
<META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
<script type="text/javascript" src="../script/common.js"></script>
<script src="../script/card.js"></script>
<script src="../script/cardjs.js"></script>
<style type="text/css">
	.t{
		background-color:#333;
	}
	.t TD{
		background-color:#FFF;
	}
	.t TH{
		background-color:#EEE;
	}
</style>
<script language="javascript">
	card.EPorED=1;
</script>
</head>
<body>
<table width="800" align=center cellpadding="4" cellspacing="1" class="t" onload="initActiveX()">
	<tr><th colspan=3>CPU卡 测试工具</th></tr>
	<tr><td>应用序列号(ASN)</td><td><input type=text id="asn"  value=""></td><td><button type="button" onclick="card.getCardSN()">读 取</button></td></tr>
	<tr><td>PSAM卡终端号</td><td><input type=text id="PsamTN"  value="">(其他数据(如PSAM卡号)看下面的“数据整体输出”)</td><td><button type="button" onclick="card.getPsamTN()">读 取</button></td></tr>
	<tr><th colspan=2>卡片公共信息</th><td rowspan=2><button type="button" onclick="card.getPublicInfo()">读 取</button></td></tr>
	<tr>
		<td>
			<table cellspacing=0 cellpadding=0 width=100%>
				<tr><td height=22>发卡方标识</td></tr>
				<tr><td height=22>应用类型标识</td></tr>
				<tr><td height=22>发卡方应用版本</td></tr>
				<tr><td height=22>应用序列号</td></tr>
				<tr><td height=22>应用启用日期</td></tr>
				<tr><td height=22>应用有效日期</td></tr>
				<tr><td height=22>发卡方自定义FCI数据</td></tr>
			</table>
		</td>
		<td>
			<table cellspacing=0 cellpadding=0 width=100%>
				<tr><td height=22><input type=text id=issuId></td></tr>
				<tr><td height=22><input type=text id=appType></td></tr>
				<tr><td height=22><input type=text id=appVersion></td></tr>
				<tr><td height=22><input type=text id=appNo></td></tr>
				<tr><td height=22><input type=text id=appStartDate></td></tr>
				<tr><td height=22><input type=text id=appStopDate></td></tr>
				<tr><td height=22><input type=text id=FCIData></td></tr>
			</table>
		</td>
	</tr>
	<tr><td>有 效 期</td><td><input type=text name=valid>(格式必须如：20080808)</td><td><button type="button" onclick="card.updateValid(valid.value)">写 入</button></td></tr>
	<tr><th colspan=2>卡片个人信息</th><td rowspan=2> <button type="button" onclick="card.getCardInfo()">读 取</button> <button type="button" onclick="card.personal(cardKind.value,contractKind.value,clientCurrentGrade.value,ifWhite.value,bankUserID.value,userName.value,userCID.value,userCKind.value,RFU.value)">写 入</button></td></tr>
	<tr>
		<td>
			<table cellspacing=0 cellpadding=0 width=100%>
				<tr><td height=22>卡类型标识</td></tr>
				<tr><td height=22>客户合同类别</td></tr>
				<!--<tr><td height=22>客户初始等级</td></tr>-->
				<tr><td height=22>客户当前等级</td></tr>
				<tr><td height=22>是否为白名单卡</td></tr>
				<tr><td height=22>本行职工标识</td></tr>
				<tr><td height=22>持卡人姓名</td></tr>
				<tr><td height=22>持卡人证件号码</td></tr>
				<tr><td height=22>持卡人证件类型</td></tr>
				<tr><td height=22>RFU</td></tr>
			</table>
		</td>
		<td>
			<table cellspacing=0 cellpadding=0 width=100%>
				<tr><td height=22><input type=text id=cardKind >(00-FF)</td></tr>				
				<tr><td height=22><input type=text id=contractKind ></td></tr>
				<!--<tr><td height=22><input type=text id=clientGrade ></td></tr>-->
				<tr><td height=22><input type=text id=clientCurrentGrade ></td></tr>
				<tr><td height=22><input type=text id=ifWhite ></td></tr>
				<tr><td height=22><input type=text id=bankUserID ></td></tr>
				<tr><td height=22><input type=text id=userName maxlength=20></td></tr>
				<tr><td height=22><input type=text id=userCID maxlength=32></td></tr>
				<tr><td height=22><input type=text id=userCKind ></td></tr>
				<tr><td height=22><input type=text id=RFU ></td></tr>
			</table>
		</td>
	</tr>
	<tr>
		<th colspan=2>卡片密码(PIN)</th>
		<td rowspan=2>
			<table cellspacing=0 cellpadding=0 width=100%>
				<tr><td height=22>&nbsp;</td></tr>
				<tr><td height=22>&nbsp;</td></tr>
				<tr><td height=22>
					<button type="button" onclick="card.getPin()">从密码键盘输密码</button>
					<br>
					<button type="button" onclick="card.verifyPin(oldPin.value)">验 密</button>
					<button type="button" onclick="javascript:card.changePin(oldPin.value,newPin.value)">修 改</button>
					<button type="button" onclick="card.reLoadPin(newPin.value)">重 置</button>
					<button type="button" onclick="card.pinUnblock(newPin.value)">解 锁</button>
				</td></tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<table cellspacing=0 cellpadding=0 width=100%>
				<tr><td height=22>原 密 码</td></tr>
				<tr><td height=22>新 密 码</td></tr>
			</table>
		</td>
		<td>
			<table cellspacing=0 cellpadding=0 width=100%>
				<tr><td height=22><input type=text name=oldPin value="123456"></td></tr>
				<tr><td height=22><input type=text name=newPin value="123456"></td></tr>
			</table>
		</td>
	</tr>
	<tr><th colspan=2>卡片金额交易</th><td>&nbsp;</td></tr>
	<tr><td>电子钱包/电子存折</td><td><input type=radio name=epored onclick="card.EPorED=1" checked>电子存折(支持圈提)&nbsp;&nbsp;<input type=radio name=epored onclick="card.EPorED=2">电子钱包</td><td>&nbsp;</td></tr>
	<tr><td>卡片余额</td><td><input type="text" id="balance" value=""> 分</td><td><button type="button" onclick="javascript:card.getBalance(oldPin.value)">读 取</button></td></tr>
	<tr><td>金&nbsp;&nbsp;&nbsp;&nbsp;额</td>
		<td>
			<input type=text name=money> 分</td><td><button type="button" onclick="card.load(money.value,oldPin.value)">圈 存</button>
			<button type="button" onclick="if(card.EPorED==2){alert('电子钱包不支持圈提,请把card.EPorED的值设置为1');}else{card.unLoad(money.value,oldPin.value)}">圈 提</button>
			<button type="button" onclick="javascript:card.greyUnlock(money.value,oldPin.value)">联机解扣</button>
		</td>
	</tr>
	<tr><td>消&nbsp;&nbsp;&nbsp;&nbsp;费</td><td><input type=text name=pmoney> 分</td><td><button type="button" onclick="card.purchase(pmoney.value)">消 费</button></td></tr>
	<tr><th colspan=2>卡片积分交易</th><td>&nbsp;</td></tr>
	<tr><td>积分余额</td><td><input type="text" id="point" value="">分
	<!--
	<select name=getloyaltykind>
	<option value=0>读取当前有效积分</option>
	<option value=1>读取指定日期后有效积分</option>
	<option value=2>读取指定日期前有效积分</option>	
	<option value=3>读取当前无效积分</option>
	</select><br>有效周期<input type=text name=cycle><br>
	-->日期<input type=text  name=getloyaltydate value="200701" >
	</td><td><button type="button" onclick="card.getloyaltyBalance(getloyaltydate.value)">读取积分</button>&nbsp;<button type="button" onclick="card.getInvalidLoyaltyBalance(getloyaltydate.value)">读取无效积分</button><span style="display:none" id="hspan">存折查询时需要PIN<input name=getPIN type=text ></span></td></tr>
	<tr><td>积分圈存</td>
		<td>
		<table id=tbcontent><tr id=tr0><td>
			交易金额<input type=text name=loyalty0>&nbsp;积分时间<input type=text name=loyaltyTime0>
		</td></tr></table>
		</td>
		<td>
			<button type="button" onclick="addText()">增</button>&nbsp;<button type="button" onclick="deleteText()">减</button>&nbsp;<button type="button" onclick="card.loyaltyLoad()">圈 存</button>
		</td>
	</tr>
	<tr><td>积分圈提</td>
	<td>金额<input type=text name=uloyalty><!--&nbsp;有效日期<input type=text name=lvalid><select name=ukind><option value=0>前</option><option value=1>后</option></select>--></td>
	<td>
		<button type="button" onclick="card.loyaltyUnload(uloyalty.value)">圈 提</button>
		<button type="button" onclick="card.greyLoyatyUnlock(uloyalty.value,oldPin.value)">联机积分解扣</button>
		</td>
	</tr>
	
	<tr><td>清除积分</td>
	<td colspan=2>日期<input type=text name=exDate>&nbsp;<button type="button" onclick="card.expiredLoyalty(exDate.value)">清除积分</button>(清除指定日期之前的所有积分)</td>
	</tr>
	
	
	<tr>
		<td>其他应用</td>
		<td colspan=2>
			<button type="button" onclick="javascript:card.getLockProof(oldPin.value)">读取灰锁状态</button>	
			<button type="button" onclick="javascript:card.getLockLoyatyProof(oldPin.value)">读取积分灰锁状态</button>			
			&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" onclick="card.appBlock()">应用锁定</button>
			&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" onclick="card.appUnblock()">应用解锁</button>
			<!--&nbsp;&nbsp;&nbsp;&nbsp;<button type="button" onclick="card.cardBlock()">卡锁定(解不了)</button><br>
			-->
			<button type="button" onclick="javascript:card.getLockProofData(oldPin.value)">读取灰锁脱机交易序号</button>
		</td>
	</tr>
	<tr><td>数据整体输出</td><td><textarea cols=60 rows=10 name=content></textarea></td>
	<td>
		<button type="button" onclick="javascript:card.getTrans(oldPin.value)">查交易明细</button><br>
		<button type="button" onclick="javascript:card.getLoyaltyTrans(oldPin.value)">查询积分交易</button>		
		</td></tr>
		<tr><td>加油应用业务信息</td>
		<td>
			<table>				
				<tr><td align=right ><font color=red>[32字节]油品限制</font></td><td>
				
					<textarea cols=20 rows=4 name=petroLimit id=petroLimit></textarea>[16进制]
				</td></tr>
				<tr><td align=right><font color=red>[60字节]商品限制</font></td><td>
					<textarea cols=20 rows=4 name=goodLimit id=goodLimit></textarea>[16进制]
					</td></tr>
				<!--
				<tr><td align=right>定点单位限制</td><td><input type=text name=unitLimit maxlength=6></td></tr>
				-->
				<tr><td align=right><font color=red>[1字节]每天加油次数限制</font></td><td><input type=text name=oneDayTimesLimit >[十进制]</td></tr>
				<tr><td align=right><font color=red>[4字节]每日加油总金额限制</font></td><td><input type=text name=oneDayAmountLimit >[十进制]</td></tr>
				<!--<tr><td align=right><font color=red>[4字节]每次消费金额限制</font></td><td><input type=text name=oneTimesAmountLimit >[十进制]</td></tr>-->
				<tr><td align=right><font color=red>[2字节]每日加油数量限制</font></td><td><input type=text name=oneDayNumLimit >[十进制]</td></tr>
				<tr><td align=right><font color=red>[4字节]每次加油数量限制</font></td><td><input type=text name=oneTimesNumLimit >[十进制]</td></tr>
				<tr><td align=right><font color=red>[1字节]加油频率限制</font></td><td><input type=text name=frequencyLimit >[十进制]</td></tr>
				
				<tr><td align=right><font color=red>16字节车号限制</font></td><td><input type=text name=carNoLimit >[字符]</td></tr>
				<!--
				<tr><td align=right>卡片地域类型</td><td><input type=text name=areaLimit maxlength=6></td></tr>
				-->
				<tr><td align=right><font color=red>[1字节]PIN码功能支持标识</td><td><input type=text name=pinFunction maxlength=2>[十六进制]</td></tr>
				
				<!--
				<tr><td align=right>结算方式标志</td><td><input type=text name=payMethod maxlength=2></td></tr>
				<tr><td align=right>油品代码</td><td><input type=text name=petroCode maxlength=2></td></tr>
				-->
				<tr><td align=right><font color=red>[6字节]客户编码</font></td><td><input type=text name=accountCode maxlength=12>[十进制]</td></tr>
				<tr><td align=right><font color=red>[1字节]开票类型标志</font></td><td><input type=text name=invoiceKind maxlength=2>[十六进制]</td></tr>
			 	<tr><td align=right><font color=red>[6字节]单位用户的单位代码</font></td><td><input type=text name=unitCode >[十六进制]</td></tr>
				<tr><td align=right><font color=red>[4字节]发卡区域</font></td><td><input type=text name=issuerCity  maxlength=8>[字符]</td></tr>
				<tr><td align=right><font color=red>[4字节]限制区域</font></td><td><input type=text name=areaLimit  maxlength=8>[字符]</td></tr>
				<tr><td align=right><font color=red>[一个限制/5字节(用;分开)]限站信息</font></td><td>
					<textarea cols=20 rows=4 name=whiteLimit ></textarea>[字符]
					
				<!--
				<tr><td align=right>单位财务编码</td><td><input type=text name=unitFinanceCode  maxlength=20></td></tr>
				<tr><td align=right>开通区域</td><td><input type=text name=canOpenProvince maxlength=4></td></tr>
				-->
			</table>

		</td>
		<td>
				<button type="button" onclick="javascript:card.getPinApp()">读PIN码功能支持标识</button><br>
						<button type="button" onclick="javascript:card.updatePinApp()">修改PIN码功能支持标识</button>
				<br><br>
		<button type="button" onclick="javascript:card.getAppInfo()">读加油应用业务信息</button><br>
		<button type="button" onclick="javascript:card.updateAppInfo()">修改油应用业务信息</button>
		</td>
		</tr>
		
		<tr><td>礼券应用</td>
		<td></td>
		<td><button type="button" onclick="javascript:card.readGift()">读取礼券</button>&nbsp;<button type="button" onclick="javascript:card.readGift()">更新礼券</button></td>
		</tr>
</table>
<input type=text name=hex id=hex maxlength=6><button type="button" onclick="javascript:card.hextobinary(hex.value)">hex to binary</button>
<button type="button" onclick="javascript:card.getOnlineLyTxNo(oldPin.value)">积分联机交易序号</button>
<br>
PosSn:<input type=text name=PosSn>
onlineTxNo:<input type=text name=onlineTxNo>
<button type="button" onclick="javascript:card.write(PosSn.value,onlineTxNo.value)">写文件</button>
<button type="button" onclick="javascript:card.read()">读文件</button>
<!--
<button type="button" onclick="javascript:card.writeDisplayNoCard(1,1,'a')">writeDisplayNoCard</button>
-->
<!--<br>
<input type=text name=binary id=binary maxlength=6><button type="button" onclick="javascript:card.binarytohex(binary.value)">binary to hex</button>
--><!--
<OBJECT classid="clsid:6A9735F1-72AA-49E9-9981-A13C3FD8641B" id=WySystem1 style="LEFT: 0px; TOP: 0px" VIEWASTEXT codebase="../common/WySystem.cab#version=1,5,0,2">
	<PARAM NAME="_ExtentX" VALUE="714">
	<PARAM NAME="_ExtentY" VALUE="714">
	<PARAM NAME="ServerName" VALUE="">
	<PARAM NAME="UserName" VALUE="">
	<PARAM NAME="PassWord" VALUE="">
	<PARAM NAME="Port" VALUE="21">
	<PARAM NAME="RemotePath" VALUE="">
	<PARAM NAME="LocalPath" VALUE="">
	<PARAM NAME="ErrorInfo" VALUE="">
	<PARAM NAME="FileSize" VALUE="0">
	<PARAM NAME="TransferSize" VALUE="0">
	<PARAM NAME="ChunkSize" VALUE="2048"></OBJECT>-->
</body>
</html>